//++++++++++++++++++++++++++++++++++++++++++++
// ENBSeries effect file - visit enbdev.com
// Copyright 2007-2014 (c) Boris Vorontsov
// Using decompiled shader of GTA4 by Rockstar Games
//++++++++++++++++++++++++++++++++++++++++++++
float4 CameraPosition;
float4 Timer;
struct VS_OUTPUT_POST{float4 vpos:POSITION;float2 txcoord0:TEXCOORD0;};
struct VS_INPUT_POST{float3 pos:POSITION;float2 txcoord0:TEXCOORD0;};
texture2D texColor;
sampler2D SamplerColor=sampler_state{Texture=<texColor>;MinFilter=LINEAR;MagFilter=LINEAR;MipFilter=NONE;AddressU=Wrap;AddressV=Wrap;SRGBTexture=FALSE;MaxMipLevel=0;MipMapLodBias=0;};
technique Shader_Clouds{pass p0{PixelShader=asm{ps_3_0
def c0,-0.5,0,12,0.5
def c1,0.125,0,-1,1
def c170,0,0,0,0
defi i0,2,0,0,0
dcl_texcoord v0.xy
dcl_2d s0
dcl_2d s1
mov r11,c153
mov r11.y,-r11.y
mul r11,r11.xyxy,c170.x
add r0,c0.x,r11.xyxy
add r0,c0.x,v0.xyxy
dp2add r1.x,r0.zwzw,r0.zwzw,c0.y
pow r2.x,r1.x,c70.x
rsq r1.x,r1.x
mul r0,r0,r1.x
mul r0,r2.x,r0
mad r0,r0,c0.z,c0.w
mul r1,r0,c1.x
mov r0.x,c72.x
mul r2.xy,r0.x,c64
mul r2.zw,r0.x,c65.xyxy
mad r0,r0.zwzw,c1.x,r2
mov r3.x,c66.x
mov r3.z,c67.x
mul r4,r1,r3.xxzz
mad r1,r1,r3.xxzz,r2
add r10,r0,r11.xyxy
texld r5,r10,s0
texld r0,r10.zwzw,s0
add r10,r1,r11.xyxy
texld r6,r10,s0
texld r1,r10.zwzw,s0
mov r5.xz,r5.xyyw
mov r5.yw,r0.xxzy
mov r0.w,c0.w
mul r0.x,r0.w,c71.x
mov r6.xz,r6.xyyw
mov r6.yw,r1.xxzy
dp2add r0.y,r6,r0.x,c0.y
dp2add r0.y,r5,c0.w,r0.y
dp2add r0.z,r6.zwzw,r0.x,c0.y
dp2add r0.z,r5.zwzw,c0.w,r0.z
mul r1,r3.xxzz,r4
mul r0.x,r0.x,c71.x
mov r4,r1
mov r5.xy,r0.yzzw
mov r0.w,r0.x
rep i0
add r6,r2,r4
mul r7,r3.xxzz,r4
mad r8,r4,r3.xxzz,r2
add r10,r6,r11.xyxy
texld r9,r10,s0
texld r6,r10.zwzw,s0
add r11,r8,r11.xyxy
texld r10,r11,s0
texld r8,r11.zwzw,s0
mov r9.xz,r9.xyyw
mov r9.yw,r6.xxzy
dp2add r3.y,r9,r0.w,r5.x
dp2add r3.w,r9.zwzw,r0.w,r5.y
mul r5.w,r0.w,c71.x
mov r6.xz,r10.xyyw
mov r6.yw,r8.xxzy
dp2add r5.x,r6,r5.w,r3.y
dp2add r5.y,r6.zwzw,r5.w,r3.w
mul r4,r3.xxzz,r7
mul r0.w,r5.w,c71.x
endrep
add r0.x,-r0.y,r5.x
add r5.z,r0.x,r0.x
add_sat r0.xyz,r5,-c68.x
mul r0.xy,r0,c69.x
mov r1.zw,c1
mad r0.z,r0.z,c69.x,r1.z
mad r0.w,c73.x,r0.z,r1.w
mov oC0.w,c1.w
mov r11,c153
mov r11.y,-r11.y
mul r11,r11.xyxy,c170.x
add r11.xy,r2,v0.xy
texld r5,r11,s1
lrp r10.xyz,c152.x,r5,r0.xyww
mov_sat oC0.xyz,r10};}}
VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN){VS_OUTPUT_POST OUT;OUT.vpos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1);OUT.txcoord0.xy=IN.txcoord0.xy;return OUT;}
float4 PS_ShiftClouds(VS_OUTPUT_POST IN):COLOR{float4 res;float4 uvsrc;uvsrc.xy=IN.txcoord0.xy;uvsrc.z=0;uvsrc.w=0;uvsrc.xy=IN.txcoord0.xy;uvsrc.w=0;res=tex2D(SamplerColor,uvsrc.xy);res.w=1;return res;}
technique ShiftClouds{pass p0{VertexShader=compile vs_3_0 VS_Quad();PixelShader=compile ps_3_0 PS_ShiftClouds();COLORWRITEENABLE=ALPHA|RED|GREEN|BLUE;CullMode=NONE;AlphaBlendEnable=FALSE;AlphaTestEnable=FALSE;SEPARATEALPHABLENDENABLE=FALSE;FogEnable=FALSE;SRGBWRITEENABLE=FALSE;}}